<template>
  <el-dialog v-if="visible" :title="info.title" :visible.sync="visible" append-to-body center width="760px" :before-close="handleCancel">
    <el-form ref="formDate" label-suffix=":" label-width="120px" :rules="rules" :model="form">
      <el-row>
        <el-col :span="24">
          <el-form-item label="附件上传" prop="files">
            <Upload v-model="form.files" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="fr mt10">
            <el-button size="small" @click="handleCancel()">取 消</el-button>
            <el-button type="primary" size="small" @click="handleEdit()">提 交</el-button>
          </div>
        </el-col>
      </el-row>
    </el-form>
  </el-dialog>
</template>

<script>
import { addFiles } from '@/api/disk'
import Upload from '@/myComponents/Upload'
import page from '@/utils/page'

export default {
  components: { Upload },
  extends: page,
  props: {
    reqAdd: {
      default: addFiles,
      type: Function
    }
  },
  data() {
    return {
      rules: {
        files: [{ required: true, trigger: 'blur', message: '附件不可为空' }]
      }
    }
  },
  watch: {
    visible(val) {
      if (val) {
        this.form = this.info.edit
      }
    }
  },
  mounted() {
  },
  methods: {
  }
}
</script>

<style>
</style>
